using System.Data.Entity;
using MusicLibrary.Models.Mapping;

namespace MusicLibrary.Models
{
    public class MusicLibraryMembership : DbContext
    {
        static MusicLibraryMembership()
        {
            Database.SetInitializer<MusicLibraryMembership>(null);
        }

        public MusicLibraryMembership()
			: base("Name=DefaultConnection")
        {
        }

        public DbSet<Application> Applications { get; set; }
        public DbSet<Membership> Memberships { get; set; }
        public DbSet<Profile> Profiles { get; set; }
        public DbSet<Role> Roles { get; set; }
        public DbSet<User> Users { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new ApplicationMap());
            modelBuilder.Configurations.Add(new MembershipMap());
            modelBuilder.Configurations.Add(new ProfileMap());
            modelBuilder.Configurations.Add(new RoleMap());
            modelBuilder.Configurations.Add(new UserMap());
        }
    }
}
